home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 07 - 1991 / 07.02 Feb 91 / Jorg Source / MacTutorApp.h < prev    next >
Encoding:
Text File  |  1990-12-18  |  1.5 KB  |  58 lines  |  [TEXT/MPS ]

  1. // Constants, resource definitions, etc.
  2.  
  3. #define kErrStrings     129
  4.  
  5. /* The following are indicies into STR# resources. */
  6. #define    eNoMemory                1
  7. #define    eNoWindow                2
  8.  
  9. #define kMinSize                48 // min heap needed in K
  10.  
  11. #define    rMenuBar    128                /* application's menu bar */
  12. #define    rAboutAlert    128                /* about alert */
  13. #define    rDocWindow    128                /* application's window */
  14.  
  15. #define    mApple                    128        /* Apple menu */
  16. #define    iAbout                    1
  17.  
  18. #define    mFile                    129        /* File menu */
  19. #define    iNew                    1
  20. #define    iClose                    4
  21. #define    iQuit                    12
  22.  
  23. #define    mEdit                    130        /* Edit menu */
  24. #define    iUndo                    1
  25. #define    iCut                    3
  26. #define    iCopy                    4
  27. #define    iPaste                    5
  28. #define    iClear                    6
  29.  
  30. #define    myMenu                    131        /* Sample menu */
  31. #define    item1                    1
  32. #define    item2                    2
  33. #define    item3                    3
  34. #define    item5                    5
  35.  
  36. class TMacTutorApp : public TApplication {
  37. public:
  38.     TMacTutorApp(void);                // Our constructor
  39.     ~TMacTutorApp(void);  // need a destructor to call EXITFORTRAN
  40.  
  41. private:
  42.     // routines from TApplication we are overriding
  43.     long HeapNeeded(void);
  44.     unsigned long SleepVal(void);
  45.     void AdjustMenus(void);
  46.     void DoMenuCommand(short menuID, short menuItem);
  47.  
  48.     // routines for our own devious purposes
  49.     void DoNew(void);
  50.     void Terminate(void);
  51. };
  52.  
  53. // kMaxOpenDocuments is used to determine whether a new document can be opened
  54. // or created. We keep track of the number of open documents, and disable the
  55. // menu items that create a new document when the maximum is reached. If the
  56. // number of documents falls below the maximum, the items are enabled again. */
  57. const short    kMaxOpenDocuments = 4;
  58.